package com.example.hp.storeapp.interf;

import com.example.hp.storeapp.bean.CookResult;
import com.example.hp.storeapp.bean.DetailResult;
import com.example.hp.storeapp.bean.FavorResult;
import com.example.hp.storeapp.bean.IsFavorResult;
import com.example.hp.storeapp.bean.LoginResult;
import com.example.hp.storeapp.bean.ChangeMeResult;
import com.example.hp.storeapp.bean.MeResult;
import com.example.hp.storeapp.bean.NoFavorSResult;
import com.example.hp.storeapp.bean.SampleResult;
import com.example.hp.storeapp.bean.ShopResult;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by HP on 2017/4/10.
 */

public interface RetrofitService {
    //http://172.24.10.130:8080/foodService/userRegister.do

    @GET("userRegister.do")
    Call<SampleResult> userRegister(@Query("username") String username,
                                    @Query("userpass") String userpass,
                                    @Query("mobilenum") String mobilenum,
                                    @Query("address") String address,
                                    @Query("comment") String comment);

    //http://172.24.10.130:8080/foodService/userLogin.do

    @GET("userLogin.do ")
    Call<LoginResult> userLogin(@Query("username") String username,
                                @Query("userpass") String userpass);

    //http://172.24.10.130:8080/foodService/getFoodByShop.do

    @GET("getFoodByShop.do")
    Call<List<CookResult>> getFoodByShop(@Query("shop_id") String shop_id);

    //http://172.24.10.130:8080/foodService/getFoodById.do
    @GET("getFoodById.do ")
    Call<DetailResult> getFoodById(@Query("food_id") String food_id);

    //http://172.24.10.130:8080/foodService/getAllUserCollection.do?user_id=1115&flag=0
    @GET("getAllUserCollection.do ")
    Call<List<FavorResult>>  getAllUserCollection(@Query("user_id") String userId,
                                                  @Query("flag") String flag);

    //http://172.24.10.130:8080/foodService/getAllShops.do
    @GET("getAllShops.do")
    Call<List<ShopResult>> getAllShops();
    //http://172.24.10.130:8080/foodService/getFoodBySearch.do
    @GET("getFoodBySearch.do")
    Call<List<CookResult>> getFoodBySearch(@Query("search") String foodName);
    //http://172.24.10.130:8080/foodService/updateUserById.do
    @GET("updateUserById.do ")
    Call<ChangeMeResult> updateUserById(@Query("user_id") String user_id,
                                        @Query("username") String username,
                                        @Query("userpass") String userpass,
                                        @Query("mobilenum") String mobilenum,
                                        @Query("address") String address);
    //http://172.24.10.130:8080/foodService/userCollectShop.do
    @GET("userCollectShop.do ")
    Call<NoFavorSResult> userCollectShop(@Query("user_id") String userId,
                                         @Query("shop_id") String shop_id);
    //http://172.24.10.130:8080/foodService/userCollectFood.do
    @GET("userCollectFood.do")
    Call<NoFavorSResult> userCollectFood(@Query("user_id") String userId,
                                         @Query("food_id") String food_id);
    //http://172.24.10.130:8080/foodService/isCollected.do
    @GET("isCollected.do ")
    Call<IsFavorResult> isCollected(@Query("user_id") String userId,
                                    @Query("shop_food_id") String shop_food_id,
                                    @Query("flag") String flag);
    @GET("getUserById.do")
    Call<MeResult>      getUserById(@Query("user_id") String user_id);

}
